// import Router from 'koa-router';
// import axios from '../utils/axios'
const Router = require('koa-router')
const axios = require('axios')
// const axios = require('../utils/axios')
// let router = new Router({prefix: '/geo'})

router.get('/getPosition', async (ctx) => {
  let {
    status,
    data: {
      province,
      city
    }
  } = await axios.get(`http://cp-tools.cn/geo/getPosition?sign=${sign}`)
  if (status === 200) {
    ctx.body = {
      province,
      city
    }
  } else {
    ctx.body = {
      province: '',
      city: ''
    }
  }
})
moudel.exports = router


// moudel.exports = {router};
export default router;

